﻿using SharpKit.JavaScript;

namespace XWeb.SharpKit.Razor
{
	/// <summary>
	/// Base interface of rendering area in JavaScript.
	/// </summary>
	public interface IRenderingArea
	{
		/// <summary>
		/// Untyped model of the area.
		/// </summary>
		[JsProperty(NativeField = false)]
		object Model { get; set; }

		/// <summary>
		/// Result of rendering the area.
		/// </summary>
		[JsProperty(NativeField = false)]
		string Result { get; }

		/// <summary>
		/// Executes rendering the area.
		/// </summary>
		void Execute();
	}

	public interface IRenderingArea<T>: IRenderingArea
	{
		/// <summary>
		/// Typed model of the area.
		/// </summary>
		[JsProperty(NativeField = false)]
		new T Model { get; set; }
	}
}
